package com.zuxia.action;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.zuxia.iservices.ContactUsServicesI;
import com.zuxia.po.Messageinfo;

/**
 * 留言ac
 * @author 谌华勇
 *2018年11月21日上午11:00:58
 */
public class MessageinfoAction extends BaseAction {
	/**
	 * 留言实体
	 */
	private Messageinfo messageInfoPo;

	/**
	 * 联系我们业务
	 */
	private ContactUsServicesI contactUsServices;
	
	/**
	 * 添加留言信息
	 * @author 谌华勇
	 *2018年11月21日上午11:01:46
	 */
	public void addMessageInfo() {
		//得到当前日期
		String nowDateTime = "";
		nowDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
		messageInfoPo.setMiTime(nowDateTime);
		//System.out.println(nowDateTime);
		//调用业务层添加留言
		try {
			super.getResponse().getWriter().print(contactUsServices.addMessageInfo(messageInfoPo));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public Messageinfo getMessageInfoPo() {
		return messageInfoPo;
	}

	public void setMessageInfoPo(Messageinfo messageInfoPo) {
		this.messageInfoPo = messageInfoPo;
	}

	public ContactUsServicesI getContactUsServices() {
		return contactUsServices;
	}

	public void setContactUsServices(ContactUsServicesI contactUsServices) {
		this.contactUsServices = contactUsServices;
	}
	
	
	
}
